package com.xiaowan.user.dao;

import com.xiaowan.user.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

public interface UserMapper {

    @ResultType(User.class)
    @Select("select * from user where id = #{id}")
    User getUserById(int id);

    @Insert("insert into user (id,name) values(#{id},#{name})")
    void saveUser(@Param("id") int id, @Param("name") String name);

    // 测试xml调用语句
    User selectUserByPrimaryKey(int id);

}
